#ifndef  __TASK_H
#define  __TASK_H
#include <semaphore.h>  



#ifdef	TASK_GLOBAL
	#define	TASK_EXT	
#else
	#define	TASK_EXT	extern
#endif
 
#define		GET_3ADATAPRIO						81//读AF、AE数据线程
#define     UART_CMD_RECEIVE_PRIO				79//接受 
#define  	UART_CMD_PROCESS_PRIO				80//串口处理 
#define		AF_MOTOR_PRO					    85//电机驱动
#define  	AUTO_IRIS_PRIO					    70//自动光?
#define		AUTO_ICR_PRIO					    90//自动ICR进程
#define     PRIVACY_PRIO                        82//隐私遮蔽
#define     TEMP_PRIO                       	86//温漂检测
#define     OIS_SERVER_PRIO                     83//隐私遮蔽



#define	THREAD_ZOOM_TELE_WIDE			(1<<0)
#define	THREAD_FOCUS_FAR_NEAR			(1<<1)
#define	THREAD_ZOOM_DIRECT				(1<<2)
#define	THREAD_FOCUS_DIRECT				(1<<3)
#define	THREAD_AF						(1<<4)

#define	THREAD_CMD_PROCESS				(1<<5)
#define	THREAD_KEY_SCAN					(1<<6)
#define	THREAD_AE						(1<<7)
#define	THREAD_KEY_PROCESS				(1<<8)
#define	THREAD_ZCF						(1<<9)
#define	THREAD_LENS_INIT			    (1<<10)
#define	THREAD_TEMP_DETECT				(1<<11)
#define	THREAD_FLASH_SAVE				(1<<12)
#define	THREAD_ALARM_OUT				(1<<13)
#define	THREAD_AUTO_ICR					(1<<14)


#define	THREAD_DZOOM_TELE_WIDE			(1<<15)
#define	THREAD_DZOOM_DIRECT				(1<<16)
#define	THREAD_PRO_AFTER_ZOOM			(1<<17)


#define		TASK_POWER_INIT_STK_SIZE			4096*2//384
#define		TASK_AUTO_IRIS_STK_SIZE				4096*2//512
#define		TASK_UART_232_STK_SIZE				4096*2//384
#define		TASK_UART_CMD_STK_SIZE				4096*2//512
#define		TASK_CAM_ZOOM_FOCUS_STK_SIZE		4096*2//512
#define		TASK_ICR_STK_SIZE					4096*2//384
#define		TASK_GET_3ADATA_STK_SIZE			4096*2//256
#define		TASK_PRIVACY_STK_SIZE				4096*2//384
#define		TASK_TEMP_STK_SIZE					4096*2//384
#define		TASK_OIS_STK_SIZE					4096*10//384

typedef struct _IPZ_ZBC_THREAD_FLAGS
{
    SW_UINT    ResetFlag;
    SW_UINT    StopDoneFlag;
    SW_UINT    OptFlag;
    SW_UINT    RunFlag;
}IPZ_ZBC_THREAD_FLAGS;

void IPZ_ZBC_THREAD_Init(void);
void IPZ_ZBC_THREAD_SendRunReq(SW_INT sta);
void IPZ_ZBC_THREAD_SendStopReq(SW_INT sta);
void IPZ_ZBC_THREAD_SendResetReq(SW_INT sta);
SW_UINT8 IPZ_ZBC_THREAD_RunReqCheck(SW_INT sta);
SW_UINT8 IPZ_ZBC_THREAD_StopReqCheck(SW_INT sta);
SW_UINT8 IPZ_ZBC_THREAD_ResetReqCheck(SW_INT sta);
SW_UINT8 IPZ_ZBC_THREAD_ExistCheck(SW_INT sta);
SW_UINT8 IPZ_ZBC_THREAD_CheckRunning(SW_INT sta);
void IPZ_ZBC_THREAD_ResetExecute(SW_INT sta);
void IPZ_ZBC_THREAD_StopExecute(SW_INT sta);
void IPZ_ZBC_THREAD_RunStart(SW_INT sta);
void IPZ_ZBC_THREAD_WaitStop(SW_INT sta);
void IPZ_ZBC_THREAD_WaitRunStart(SW_INT sta);
void IPZ_ZBC_THREAD_AFReset(void);    
SW_BOOL IPZ_ZBC_THREAD_CheckMotorRun(void);
void IPZ_ZBC_THREAD_AFResetConditioned(void);
void IPZ_ZBC_THREAD_AutoExpose(void);
void IPZ_ZBC_THREAD_ZoomFocus(void);
void IPZ_ZBC_THREAD_SeperateDzoom(void);
void IPZ_ZBC_THREAD_AutoICR(void);
void IPZ_ZBC_THREAD_TempDect(void);



#endif

